//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web;
using CommunityServer.Components;
using CommunityServer.Configuration;

namespace CommunityServer.Blogs.Components
{
	/// <summary>
	/// Summary description for AttachmentHandler.
	/// </summary>
	public class AttachmentHandler : IHttpHandler
	{
		public AttachmentHandler()
		{
			//
			// TODO: Add constructor logic here
			//
		}

        public void ProcessRequest(HttpContext context)
        {
            CSContext csContext = CSContext.Current;

            Weblog blog = Weblogs.GetWeblog(csContext.ApplicationKey);
            Permissions.AccessCheck(blog,Permission.View,csContext.User);

           
            AttachmentSettings fs = WeblogConfiguration.Instance().AttachmentSettings;
            fs.HandleHttpRequest(context,blog);
           
        }

	    public bool IsReusable
	    {
	        get { return false; }
	    }
	}
}
